package com.xinminda.dcf.ui.news.presenter;

import com.google.gson.Gson;
import com.orhanobut.logger.Logger;
import com.xinminda.dcf.base.baserx.RxSubscriber;
import com.xinminda.dcf.bean.ColumnsBean;
import com.xinminda.dcf.ui.news.contract.NewsMainContract;
import com.xinminda.dcf.utils.ToastUtil;
import java.util.List;

public class NewMainPresenter extends NewsMainContract.Presenter{
    @Override
    public void lodeMineChannelsRequest() {

        mModel.lodeMineNewsChannels().subscribe(new RxSubscriber<List<ColumnsBean>>(mContext,true){
            @Override
            protected void _onNext(List<ColumnsBean> columnsBean) {
                Logger.d(new Gson().toJson(columnsBean));
                mView.returnMineNewsChannels(columnsBean);
            }

            @Override
            protected void _onError(String message) {
                ToastUtil.showShort(message);
            }
        });
    }
}
